deploy: Ensure that any modified config files are fsync()d
authorColin Walters <walters@verbum.org>
Tue, 8 Apr 2014 21:37:35 +0000 (17:37 -0400)
committerColin Walters <walters@verbum.org>
Fri, 11 Apr 2014 22:43:13 +0000 (18:43 -0400)
It really wouldn't do for one to be missing one's ssh keys for
example...

src/libostree/ostree-sysroot-deploy.c

index 8af5f2c2942ea963389759d2dd95c3198853177b..44ad9598c282cb80e4e68f75edc29ddf0592d7d3 100644 (file)
@@ -86,6 +86,11 @@ copy_modified_config_file (GFile              *orig_etc,
       if (!g_file_copy (src, dest, G_FILE_COPY_OVERWRITE | G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_ALL_METADATA,
                         cancellable, NULL, NULL, error))
         goto out;
+      if (g_file_info_get_file_type (src_info) == G_FILE_TYPE_REGULAR)
+        {
+          if (!gs_file_sync_data (dest, cancellable, error))
+            goto out;
+        }
     }
 
   ret = TRUE;